﻿<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>口水电影网</title>
		<meta name="keywords" content="口水电影网,最新电影网,最快电影网" />
		<meta name="description" content="口水电影网,最新电影网,最快电影网" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link href="assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="assets/css/ace.min.css" />
		<link rel="stylesheet" href="assets/css/font-awesome.min.css" />
		<link href="lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
		<script src="lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script> 
		<script src="lib/ligerUI/js/ligerui.min.js" type="text/javascript"></script> 
    	<script type="text/javascript">
          var data = [];
          var tab = null;
          var tree = null;
          function f_heightChanged(options)
          {
              if (tab)
                  tab.addHeight(options.diff);
              $("#accordion1").each(function ()
              {
                  $(this).height($(this).parent().height() - $(this).prev().height());
              });

          }
          var tabnumber = 0;
          $(function (){
        	//获取菜单数据
          	$.ajax({
                  type: 'post', cache: false, dataType: 'json',
                  url: '${ctx}/back/SysUser-getTree.action',
                  success: function (result){
                  	indexdata1=eval(result.data);
          			$("#tree1").ligerTree({
          			    data: indexdata1,
          			    checkbox: false,
          			    slide: false,
          			    nodeWidth: 120,
          			    attribute: ['nodename', 'url'],
          			    onSelect: function (node){
          			    	if (!node.data) return;
          			        if (!node.data.url) return;
          			        var tabid = $(node.target).attr("tabid");
          			        if (!tabid){
          			            tabid = new Date().getTime();
          			            $(node.target).attr("tabid", tabid)
          			        }
          			        f_addTab(tabid, node.data.text, node.data.url);
          			    }
          			});
                  }
              });
               //布局
              $("#layout1").ligerLayout({
                  leftWidth: 190,
                  height: '100%',
                  heightDiff: -34,
                  space: 4,
                  onHeightChanged: f_heightChanged
              });

              var height = $(".l-layout-center").height();

              //Tab
              $("#framecenter").ligerTab({ height: height });

              //树
              $("#tree1").ligerTree({
                  checkbox: false,
                  slide: false,
                  nodeWidth: 100,
                  data: getTreeData(),
                  attribute: ['nodename', 'url', 'tabid'],
                  onSelect: function (node)
                  {
                      if (!node.data.url) return;
                      f_addTab(node.data.tabid, node.data.tag + " " + node.data.text, node.data.url);
                  }
              });

              tab = $("#framecenter").ligerGetTabManager();
              tree = $("#tree1").ligerGetTreeManager();
              $("#pageloading").hide();

              $("#accordion1").each(function ()
              {
                  $(this).height($(this).parent().height() - $(this).prev().height());
              });

              f_parminit();
          });
          function f_parminit()
          {
              var inittabid = getParm();
              if (!inittabid) return;
              $("#tree1 li[tabid=" + inittabid + "] span").click();
          }
          function f_addTab(tabid, text, url)
          {
              tabid = tabid || liger.getId();
              tab.addTabItem({ tabid: tabid, text: text, url: url });
          }
          function f_closeWindow(frame)
          {
              for (var i = 0; i < document.frames.length; i++)
              {
                  if (document.frames[i] == frame)
                  {
                      $(".l-window[framename=" + document.frames[i].name + "]").remove();
                      return;
                  }
              }
          }
          function f_openWindow(url, title, width, height){
              return $.ligerWindow.show({ width: width, height: height, left: 100, top: 100, title: title, url: url });
          }
          function f_open(url){
              $.ligerWindow.show({ width: 300, height: 300, left: 100, top: 100, title: '我的标题', url: url });
          }
          function f_openWithContent(content){
              var chtml = "<div style='padding:10px'>" + content + "</div>";
              $.ligerWindow.show({ width: 300, height: 300, left: 200, top: 200, title: '我的标题', content: chtml });
          }
          function getParm() {
              if (location.href.indexOf("#") == -1)
              {
                  return null;
              }
              else
              {
                  var urlQuery = location.href.split("#");
                  return urlQuery[1];
              }
              return null;
          }
    </script>
    </head>
<body>
  <div class="l-loading" style="display: block" id="pageloading">
    </div>
   <div class="navbar navbar-default" id="navbar">

			<div class="navbar-container" id="navbar-container">
				<div class="navbar-header pull-left">
					<a href="#" class="navbar-brand">
						<small>
							<i class="icon-leaf"></i>
							口水电影后台管理系统
						</small>
					</a><!-- /.brand -->
				</div><!-- /.navbar-header -->
				<div class="navbar-header pull-right" role="navigation">
					<ul class="nav ace-nav">
						<li class="grey">
							<a data-toggle="dropdown" class="dropdown-toggle" href="#">
								<i class="icon-tasks"></i>
								<span class="badge badge-grey">4</span>
							</a>
						</li>
						<li class="purple">
							<a data-toggle="dropdown" class="dropdown-toggle" href="#">
								<i class="icon-bell-alt icon-animated-bell"></i>
								<span class="badge badge-important">8</span>
							</a>
						</li>
						<li class="green">
							<a data-toggle="dropdown" class="dropdown-toggle" href="#">
								<i class="icon-envelope icon-animated-vertical"></i>
								<span class="badge badge-success">5</span>
							</a>
							<ul></ul>
						</li>
						<li class="light-blue">
							<a data-toggle="dropdown" href="#" class="dropdown-toggle">
								<img class="nav-user-photo" src="assets/avatars/user.jpg" alt="Jason's Photo" />
								<span class="user-info">
									<small>欢迎光临,</small>
									Jason
								</span>
								<i class="icon-caret-down"></i>
							</a>
							<ul></ul>
						</li>
					</ul><!-- /.ace-nav -->
				</div><!-- /.navbar-header -->
			</div><!-- /.container -->
		</div>
    <div id="layout1" style="width:99.2%; margin:0 auto; margin-top:4px; ">
        <div position="left" id="accordion1" title="导航">
            <ul id="tree1" style="margin-top: 3px;">
            </ul>
        </div>
        <div position="center" id="framecenter">
            <div tabid="home" title="我的主页" style="height: 300px">
                <iframe frameborder="0" name="home" src="welcome.htm"></iframe>
            </div>
        </div>  
    </div>
        <div  style="height:32px; line-height:32px; text-align:center;">
            Copyright © 2011-2013 www.ligerui.com
    </div>

</body>
</html>

